package main

import (
	"runtime"
	"sync"
	"time"
)

func main() {
	runtime.GOMAXPROCS(4)
	var wg sync.WaitGroup
	wg.Add(1)
	time.Sleep(time.Second /10)
	go func() {
		wg.Wait()
		println("main exit..")
	}()
	go func() {
		time.Sleep(time.Second)
		println("done.")
		wg.Done()
	}()
	wg.Wait()
	println("main exit ...")
}
